Can I add a label to the toolbar?

Last post 11-30-2012, 6:23 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  11-29-2012, 3:10 PM 75370

    Can I add a label to the toolbar?

    I've got two editors on a page.  I'd like to put a label in the toolbar on the left, and position a custom toolbar on the right.  It would be nice to do it from code-behind.  I'm using the following configuration file.

    Cheers,

    Jeff

     

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
          <toolbars>
                <item type="g_start" />
                <item type="image" name="NetSpell" imagename="spell" />
                <item type="image" name="Bold" />
                <item type="image" name="Italic" />
                <item type="image" name="Underline" imagename="under" />
                <item type="image" name="JustifyLeft" imagename="left" />
                <item type="image" name="JustifyCenter" imagename="center" />
                <item type="image" name="JustifyRight" imagename="right" />
                <item type="image" name="InsertOrderedList" imagename="numlist" />
                <item type="image" name="InsertUnorderedList" imagename="bullist" />
                <item type="image" name="ToFullPage" command="FullPage" imagename="fit" hotkey="F12" />
                <item type="image" name="FromFullPage" command="FullPage" imagename="restore" hotkey="F12" />
        <item type="g_end" />    
          </toolbars>
    </configuration>

     

    Filed under:
  •  11-30-2012, 6:23 AM 75375 in reply to 75370

    Re: Can I add a label to the toolbar?

    Hi jagilbert27,

     

    Please try the example below, it shows you how add a label at the left of the toolbar.

     

    1. <%@ Page Language="C#" %> 
    2.  
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %> 
    4. <html> 
    5. <head> 
    6.     <title>example </title> 
    7.     <script runat="server"
    8.         protected override void OnLoad(EventArgs e) 
    9.         { 
    10.             Label lb = new Label(); 
    11.             lb.Text = "my label"
    12.             CuteEditor.ToolControl tc = new ToolControl("mylabel", lb); 
    13.             Editor1.ToolControls.Insert(1, tc); 
    14.             base.OnLoad(e); 
    15.         } 
    16.     </script> 
    17. </head> 
    18. <body> 
    19.     <form id="Form1" runat="server"
    20.     <CE:Editor ID="Editor1" runat="server"
    21.     </CE:Editor> 
    22.     </form> 
    23. </body> 
    24. </html> 
     

    More detail of the custom button for toolbar, please refer to http://cutesoft.net/developer+guide/scr/Add_your_own_custom_button.htm

     

    Regards,

     

    Ken

     

     

View as RSS news feed in XML